import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import { reduceModuleFile } from '@/libs/utils'

Vue.use(Vuex)

// https://webpack.js.org/guides/dependency-management/#requirecontext
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = reduceModuleFile(modulesFiles);

export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  modules: modules,
  getters: getters
})